#!/bin/sh

echo -n "Choose PREFIX (/usr): "
read PREFIX
[ "$PREFIX" = "" ] && PREFIX="/usr"
export PREFIX="$PREFIX"
if [ ! -d "$PREFIX" ];then
 echo "ERROR: $PREFIX does not exist!"
 exit 1
fi
echo "Installing scripts into $PREFIX/sbin"
[ ! -d ${PREFIX}/sbin ] && mkdir -p ${PREFIX}/sbin
cp -f sbin/pwireless ${PREFIX}/sbin/pwireless
[ ! -d ${PREFIX}/share/pwireless/locale ] && mkdir -p ${PREFIX}/share/pwireless/locale
for PO in `ls share/locale | grep .po`
do
 cp -af share/locale/$PO ${PREFIX}/share/pwireless/locale/$PO
done
cp -af share/pwireless.desktop ${PREFIX}/share/applications/pwireless.desktop
